package com.becca.cake.model.goods;

import java.io.Serializable;
import java.util.Date;

import com.becca.cake.core.exception.ServiceException;

/**
 * 商品主题中间实体
 * @copyright  尊星(上海)信息科技有限公司
 * @author hejinguo
 * @date 2016年4月10日 上午2:51:31
 */
public class GoodsSubjectModel implements Serializable {
    /**  */
    private static final long serialVersionUID = -1907757073965672675L;

    private Integer           id;
    /**商品ID*/
    private Integer           goodsId;
    /**主题ID*/
    private Integer           subjectId;
    /**创建时间*/
    private Date              createdDate;
    /**创建人*/
    private String            createdName;
    
    /**主题名称*/
    private String             subjectName;
    /**主题图片*/
    private String             subjectPic;
    /**主题排序*/
    private Integer            subjectOrder;
    /**主题状态(0:未发布 1:已发布 2:已撤销)*/
    private Byte               subjectStatus;
    
    /**商品名称*/
    private String             goodsName;
    /**商品编码*/
    private String             goodsCode;
    /**商品状态*/
    private Byte             goodsStatus;
    /**商品展示图*/
    private String             goodsPic;
    
    /**该主题中已存在此商品*/
    public static final String SUBJECTGOODS_EXSIT = "该主题中已存在此商品";
    /**该主题已被撤销，请重新刷新页面*/
    public static final String SUBJECT_CANCEL = "该主题已被撤销，请重新刷新页面";
    /**该商品已下架*/
    public static final String GOODS_DOWN = "该商品已下架";
    /**该商品已从该主题中移除*/
    public static final String SUBJECTGOODS_REMOVE_EXSIT = "该商品已从该主题中移除";
    /**添加的商品不存在*/
    public static final String GOODS_NULL = "添加的商品不存在";
    
    /**添加主题商品校验*/
    public static void validInsertSubjectGoods(GoodsSubjectModel goodsSubjectModel){
        if(goodsSubjectModel.getGoodsId() == null){
            throw new ServiceException(GoodsSubjectModel.GOODS_NULL);
        }
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Integer subjectId) {
        this.subjectId = subjectId;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public String getCreatedName() {
        return createdName;
    }

    public void setCreatedName(String createdName) {
        this.createdName = createdName;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getSubjectPic() {
        return subjectPic;
    }

    public void setSubjectPic(String subjectPic) {
        this.subjectPic = subjectPic;
    }

    public Integer getSubjectOrder() {
        return subjectOrder;
    }

    public void setSubjectOrder(Integer subjectOrder) {
        this.subjectOrder = subjectOrder;
    }

    public Byte getSubjectStatus() {
        return subjectStatus;
    }

    public void setSubjectStatus(Byte subjectStatus) {
        this.subjectStatus = subjectStatus;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public String getGoodsPic() {
        return goodsPic;
    }

    public void setGoodsPic(String goodsPic) {
        this.goodsPic = goodsPic;
    }
    

    public Byte getGoodsStatus() {
        return goodsStatus;
    }

    public void setGoodsStatus(Byte goodsStatus) {
        this.goodsStatus = goodsStatus;
    }

    @Override
    public String toString() {
        return "GoodsSubjectDO [id=" + id + ", goodsId=" + goodsId + ", subjectId=" + subjectId
               + ", createdDate=" + createdDate + ", createdName=" + createdName + "]";
    }

}
